<template>
    <div>

      <header-nav>
        全部分类
      </header-nav>
      <div class="games">
        <!--{{games}}-->
        <game-list v-for="game in games" :game="game">

        </game-list>
      </div>
    </div>
</template>
<script>
  import HeaderNav from '../components/HeaderNav'
  import GameList from '../components/GameList'
    export default{
      components:{
          HeaderNav, GameList
      },
      data:function(){
          return {
            games:[]
          }
      },
      mounted:function(){
          this.getValue()
      },
      methods:{
          getValue:function(){
              this.$http.get('/douyuapi/api/RoomApi/game').then(function(res){
                  console.log(res.data)
                  this.games = res.body.data
              })
          }
      }
    }
</script>
<style scoped>
  .games{
    position:relative; top:45px;
  }
</style>
